package com.net;

import android.util.Log;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by xiaolong.wei on 2018/8/13.
 */

public class HKInterceptor implements Interceptor {

    private static final String TAG = "HKInterceptor";
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request original = chain.request();
        Request.Builder requestBuilder = original.newBuilder()
                                        .addHeader("source","app");
        Request request = requestBuilder.build();
        String s = original.body().toString();
        Log.d(TAG, "intercept: "+s);

        return chain.proceed(request);
    }
}
